#pragma once
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
	void bettle(int a, int h, int b, int k) {
		int ans = 0;
		int n = min(k / a, h / b);
		ans += (a + b) * n;
		h -= b * n, k -= a * n;
		if (h > 0 && k > 0) {
			h -= b, k -= a;
			ans += a + b;
		}
		if (h > 0) {
			ans += a * 10;
		}
		else if (k > 0) {
			ans += b * 10;
		}
		cout << ans;
	}

	int n;
	string s;
	int func() {
		bool flag = true;
		for (int i = 1; i < n; ++i) {
			if (s[i] != s[0]) {
				flag = false;
				break;
			}
		}
		if (flag) return 0;

		int left = 0, right = n - 1;
		while (left<right) {
			if (s[left] == s[right])
				++left, --right;
			else
			{
				flag = true;
				break;
			}
		}
		if (!flag) return n-1;
		else return n;
	}

	void asymmetric(string str) {
		n = str.size();
		s = str;
		cout<< func();
	}
};
